function SrvApi(params){ 
	 
}

SrvApi.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvApi.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvApi.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvApi.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.saId=function(saId){if(this.proxy)return this.getProxy().saId(saId);  this.put("saId", saId);return this;};
	/** and sa_id is null */
	this.saIdNull=function(){if(this.proxy)return this.getProxy().saIdNull();if(this.get("saIdNot")==null)this.put("saIdNot", "");this.put("saId", null);return this;};
	/** not .... */
	this.saIdNot=function(){if(this.proxy)return this.getProxy().saIdNot();this.put("saIdNot", "not");return this;};
	this.saIdNotNull=function(){if(this.proxy)return this.getProxy().saIdNotNull();this.put("saIdNot", "not");this.put("saId", null);return this;};
	this.saIdNot=function(saId){if(this.proxy)return this.getProxy().saIdNot(saId);this.put("saIdNot", "not");this.put("saId", saId);return this;};
		
	/** and sa_id <= ? */
	this.saIdMin=function(min){if(this.proxy)return this.getProxy().saIdMin(min);this.put("saIdMin", min);return this;};
	/** and sa_id >= ? */
	this.saIdMax=function(max){if(this.proxy)return this.getProxy().saIdMax(max);this.put("saIdMax", max);return this;};
		
		
	this.saIdIn=function(ids){
		if(this.proxy)return this.getProxy().saIdIn(ids);  this.put("saIdIn", ids);return this;
	};	
		 
	
	
	/** API名称 [非空]    中文描述   **/
	this.saName=function(saName){if(this.proxy)return this.getProxy().saName(saName);  this.put("saName", saName);return this;};
	/** and sa_name is null */
	this.saNameNull=function(){if(this.proxy)return this.getProxy().saNameNull();if(this.get("saNameNot")==null)this.put("saNameNot", "");this.put("saName", null);return this;};
	/** not .... */
	this.saNameNot=function(){if(this.proxy)return this.getProxy().saNameNot();this.put("saNameNot", "not");return this;};
	this.saNameNotNull=function(){if(this.proxy)return this.getProxy().saNameNotNull();this.put("saNameNot", "not");this.put("saName", null);return this;};
	this.saNameNot=function(saName){if(this.proxy)return this.getProxy().saNameNot(saName);this.put("saNameNot", "not");this.put("saName", saName);return this;};
		
		 
	
	
	/** 名称空间 [非空]    格式如:com.xxxx.xxx   **/
	this.saNamespace=function(saNamespace){if(this.proxy)return this.getProxy().saNamespace(saNamespace);  this.put("saNamespace", saNamespace);return this;};
	/** and sa_namespace is null */
	this.saNamespaceNull=function(){if(this.proxy)return this.getProxy().saNamespaceNull();if(this.get("saNamespaceNot")==null)this.put("saNamespaceNot", "");this.put("saNamespace", null);return this;};
	/** not .... */
	this.saNamespaceNot=function(){if(this.proxy)return this.getProxy().saNamespaceNot();this.put("saNamespaceNot", "not");return this;};
	this.saNamespaceNotNull=function(){if(this.proxy)return this.getProxy().saNamespaceNotNull();this.put("saNamespaceNot", "not");this.put("saNamespace", null);return this;};
	this.saNamespaceNot=function(saNamespace){if(this.proxy)return this.getProxy().saNamespaceNot(saNamespace);this.put("saNamespaceNot", "not");this.put("saNamespace", saNamespace);return this;};
		
		 
	
	
	/** 接口分类 [非空] [SrvApiType]      **/
	this.saType=function(saType){if(this.proxy)return this.getProxy().saType(saType);  this.put("saType", saType);return this;};
	/** and sa_type is null */
	this.saTypeNull=function(){if(this.proxy)return this.getProxy().saTypeNull();if(this.get("saTypeNot")==null)this.put("saTypeNot", "");this.put("saType", null);return this;};
	/** not .... */
	this.saTypeNot=function(){if(this.proxy)return this.getProxy().saTypeNot();this.put("saTypeNot", "not");return this;};
	this.saTypeNotNull=function(){if(this.proxy)return this.getProxy().saTypeNotNull();this.put("saTypeNot", "not");this.put("saType", null);return this;};
	this.saTypeNot=function(saType){if(this.proxy)return this.getProxy().saTypeNot(saType);this.put("saTypeNot", "not");this.put("saType", saType);return this;};
		
		
	this.saTypeIn=function(ids){
		if(this.proxy)return this.getProxy().saTypeIn(ids);  this.put("saTypeIn", ids);return this;
	};	
		 
	
	
	/** 版本号    1:V1 2:V2 3:V3     **/
	this.saVersion=function(saVersion){if(this.proxy)return this.getProxy().saVersion(saVersion);  this.put("saVersion", saVersion);return this;};
	/** and sa_version is null */
	this.saVersionNull=function(){if(this.proxy)return this.getProxy().saVersionNull();if(this.get("saVersionNot")==null)this.put("saVersionNot", "");this.put("saVersion", null);return this;};
	/** not .... */
	this.saVersionNot=function(){if(this.proxy)return this.getProxy().saVersionNot();this.put("saVersionNot", "not");return this;};
	this.saVersionNotNull=function(){if(this.proxy)return this.getProxy().saVersionNotNull();this.put("saVersionNot", "not");this.put("saVersion", null);return this;};
	this.saVersionNot=function(saVersion){if(this.proxy)return this.getProxy().saVersionNot(saVersion);this.put("saVersionNot", "not");this.put("saVersion", saVersion);return this;};
		
		
	this.saVersionIn=function(ids){
		if(this.proxy)return this.getProxy().saVersionIn(ids);  this.put("saVersionIn", ids);return this;
	};	
		 
	
	
	/** 是否开放    1:开放 0:非开放     **/
	this.saOpen=function(saOpen){if(this.proxy)return this.getProxy().saOpen(saOpen);  this.put("saOpen", saOpen);return this;};
	/** and sa_open is null */
	this.saOpenNull=function(){if(this.proxy)return this.getProxy().saOpenNull();if(this.get("saOpenNot")==null)this.put("saOpenNot", "");this.put("saOpen", null);return this;};
	/** not .... */
	this.saOpenNot=function(){if(this.proxy)return this.getProxy().saOpenNot();this.put("saOpenNot", "not");return this;};
	this.saOpenNotNull=function(){if(this.proxy)return this.getProxy().saOpenNotNull();this.put("saOpenNot", "not");this.put("saOpen", null);return this;};
	this.saOpenNot=function(saOpen){if(this.proxy)return this.getProxy().saOpenNot(saOpen);this.put("saOpenNot", "not");this.put("saOpen", saOpen);return this;};
		
		
	this.saOpenIn=function(ids){
		if(this.proxy)return this.getProxy().saOpenIn(ids);  this.put("saOpenIn", ids);return this;
	};	
		 
	
	
	/** 需要用户授权 [非空]   0:无需授权 1:需要授权     **/
	this.saOauth=function(saOauth){if(this.proxy)return this.getProxy().saOauth(saOauth);  this.put("saOauth", saOauth);return this;};
	/** and sa_oauth is null */
	this.saOauthNull=function(){if(this.proxy)return this.getProxy().saOauthNull();if(this.get("saOauthNot")==null)this.put("saOauthNot", "");this.put("saOauth", null);return this;};
	/** not .... */
	this.saOauthNot=function(){if(this.proxy)return this.getProxy().saOauthNot();this.put("saOauthNot", "not");return this;};
	this.saOauthNotNull=function(){if(this.proxy)return this.getProxy().saOauthNotNull();this.put("saOauthNot", "not");this.put("saOauth", null);return this;};
	this.saOauthNot=function(saOauth){if(this.proxy)return this.getProxy().saOauthNot(saOauth);this.put("saOauthNot", "not");this.put("saOauth", saOauth);return this;};
		
		
	this.saOauthIn=function(ids){
		if(this.proxy)return this.getProxy().saOauthIn(ids);  this.put("saOauthIn", ids);return this;
	};	
		 
	
	
	/** 接口说明        **/
	this.saDescript=function(saDescript){if(this.proxy)return this.getProxy().saDescript(saDescript);  this.put("saDescript", saDescript);return this;};
	/** and sa_descript is null */
	this.saDescriptNull=function(){if(this.proxy)return this.getProxy().saDescriptNull();if(this.get("saDescriptNot")==null)this.put("saDescriptNot", "");this.put("saDescript", null);return this;};
	/** not .... */
	this.saDescriptNot=function(){if(this.proxy)return this.getProxy().saDescriptNot();this.put("saDescriptNot", "not");return this;};
	this.saDescriptNotNull=function(){if(this.proxy)return this.getProxy().saDescriptNotNull();this.put("saDescriptNot", "not");this.put("saDescript", null);return this;};
	this.saDescriptNot=function(saDescript){if(this.proxy)return this.getProxy().saDescriptNot(saDescript);this.put("saDescriptNot", "not");this.put("saDescript", saDescript);return this;};
		
		 
	
	
	/** 接口类名 [非空]    脚本代码为java代码,参数结构中定义的变量名可直接使用,有错误返回错误代码，没错误无需返回   **/
	this.saClass=function(saClass){if(this.proxy)return this.getProxy().saClass(saClass);  this.put("saClass", saClass);return this;};
	/** and sa_class is null */
	this.saClassNull=function(){if(this.proxy)return this.getProxy().saClassNull();if(this.get("saClassNot")==null)this.put("saClassNot", "");this.put("saClass", null);return this;};
	/** not .... */
	this.saClassNot=function(){if(this.proxy)return this.getProxy().saClassNot();this.put("saClassNot", "not");return this;};
	this.saClassNotNull=function(){if(this.proxy)return this.getProxy().saClassNotNull();this.put("saClassNot", "not");this.put("saClass", null);return this;};
	this.saClassNot=function(saClass){if(this.proxy)return this.getProxy().saClassNot(saClass);this.put("saClassNot", "not");this.put("saClass", saClass);return this;};
		
		 
	
	
	/** 数据方向    0:请求 1:推送     **/
	this.saDir=function(saDir){if(this.proxy)return this.getProxy().saDir(saDir);  this.put("saDir", saDir);return this;};
	/** and sa_dir is null */
	this.saDirNull=function(){if(this.proxy)return this.getProxy().saDirNull();if(this.get("saDirNot")==null)this.put("saDirNot", "");this.put("saDir", null);return this;};
	/** not .... */
	this.saDirNot=function(){if(this.proxy)return this.getProxy().saDirNot();this.put("saDirNot", "not");return this;};
	this.saDirNotNull=function(){if(this.proxy)return this.getProxy().saDirNotNull();this.put("saDirNot", "not");this.put("saDir", null);return this;};
	this.saDirNot=function(saDir){if(this.proxy)return this.getProxy().saDirNot(saDir);this.put("saDirNot", "not");this.put("saDir", saDir);return this;};
		
		
	this.saDirIn=function(ids){
		if(this.proxy)return this.getProxy().saDirIn(ids);  this.put("saDirIn", ids);return this;
	};	
		 
	
	
	/** 函数名称 [非空]       **/
	this.saMethod=function(saMethod){if(this.proxy)return this.getProxy().saMethod(saMethod);  this.put("saMethod", saMethod);return this;};
	/** and sa_method is null */
	this.saMethodNull=function(){if(this.proxy)return this.getProxy().saMethodNull();if(this.get("saMethodNot")==null)this.put("saMethodNot", "");this.put("saMethod", null);return this;};
	/** not .... */
	this.saMethodNot=function(){if(this.proxy)return this.getProxy().saMethodNot();this.put("saMethodNot", "not");return this;};
	this.saMethodNotNull=function(){if(this.proxy)return this.getProxy().saMethodNotNull();this.put("saMethodNot", "not");this.put("saMethod", null);return this;};
	this.saMethodNot=function(saMethod){if(this.proxy)return this.getProxy().saMethodNot(saMethod);this.put("saMethodNot", "not");this.put("saMethod", saMethod);return this;};
		
		 
	
	
	/** 记录日志    0:否 1:是     **/
	this.saLog=function(saLog){if(this.proxy)return this.getProxy().saLog(saLog);  this.put("saLog", saLog);return this;};
	/** and sa_log is null */
	this.saLogNull=function(){if(this.proxy)return this.getProxy().saLogNull();if(this.get("saLogNot")==null)this.put("saLogNot", "");this.put("saLog", null);return this;};
	/** not .... */
	this.saLogNot=function(){if(this.proxy)return this.getProxy().saLogNot();this.put("saLogNot", "not");return this;};
	this.saLogNotNull=function(){if(this.proxy)return this.getProxy().saLogNotNull();this.put("saLogNot", "not");this.put("saLog", null);return this;};
	this.saLogNot=function(saLog){if(this.proxy)return this.getProxy().saLogNot(saLog);this.put("saLogNot", "not");this.put("saLog", saLog);return this;};
		
		
	this.saLogIn=function(ids){
		if(this.proxy)return this.getProxy().saLogIn(ids);  this.put("saLogIn", ids);return this;
	};	
		 
	
	
	/** 参数结构        **/
	this.saParams=function(saParams){if(this.proxy)return this.getProxy().saParams(saParams);  this.put("saParams", saParams);return this;};
	/** and sa_params is null */
	this.saParamsNull=function(){if(this.proxy)return this.getProxy().saParamsNull();if(this.get("saParamsNot")==null)this.put("saParamsNot", "");this.put("saParams", null);return this;};
	/** not .... */
	this.saParamsNot=function(){if(this.proxy)return this.getProxy().saParamsNot();this.put("saParamsNot", "not");return this;};
	this.saParamsNotNull=function(){if(this.proxy)return this.getProxy().saParamsNotNull();this.put("saParamsNot", "not");this.put("saParams", null);return this;};
	this.saParamsNot=function(saParams){if(this.proxy)return this.getProxy().saParamsNot(saParams);this.put("saParamsNot", "not");this.put("saParams", saParams);return this;};
		
		 
	
	
	/** 返回结构 [非空]       **/
	this.saReturnStruct=function(saReturnStruct){if(this.proxy)return this.getProxy().saReturnStruct(saReturnStruct);  this.put("saReturnStruct", saReturnStruct);return this;};
	/** and sa_return_struct is null */
	this.saReturnStructNull=function(){if(this.proxy)return this.getProxy().saReturnStructNull();if(this.get("saReturnStructNot")==null)this.put("saReturnStructNot", "");this.put("saReturnStruct", null);return this;};
	/** not .... */
	this.saReturnStructNot=function(){if(this.proxy)return this.getProxy().saReturnStructNot();this.put("saReturnStructNot", "not");return this;};
	this.saReturnStructNotNull=function(){if(this.proxy)return this.getProxy().saReturnStructNotNull();this.put("saReturnStructNot", "not");this.put("saReturnStruct", null);return this;};
	this.saReturnStructNot=function(saReturnStruct){if(this.proxy)return this.getProxy().saReturnStructNot(saReturnStruct);this.put("saReturnStructNot", "not");this.put("saReturnStruct", saReturnStruct);return this;};
		
		 
	
	
	/** 错误代码        **/
	this.saError=function(saError){if(this.proxy)return this.getProxy().saError(saError);  this.put("saError", saError);return this;};
	/** and sa_error is null */
	this.saErrorNull=function(){if(this.proxy)return this.getProxy().saErrorNull();if(this.get("saErrorNot")==null)this.put("saErrorNot", "");this.put("saError", null);return this;};
	/** not .... */
	this.saErrorNot=function(){if(this.proxy)return this.getProxy().saErrorNot();this.put("saErrorNot", "not");return this;};
	this.saErrorNotNull=function(){if(this.proxy)return this.getProxy().saErrorNotNull();this.put("saErrorNot", "not");this.put("saError", null);return this;};
	this.saErrorNot=function(saError){if(this.proxy)return this.getProxy().saErrorNot(saError);this.put("saErrorNot", "not");this.put("saError", saError);return this;};
		
		 
	
	
	/** 修改时间 [非空]       **/
	this.saUpdateTime=function(saUpdateTime){if(this.proxy)return this.getProxy().saUpdateTime(saUpdateTime);  this.put("saUpdateTime", saUpdateTime);return this;};
	/** and sa_update_time is null */
	this.saUpdateTimeNull=function(){if(this.proxy)return this.getProxy().saUpdateTimeNull();if(this.get("saUpdateTimeNot")==null)this.put("saUpdateTimeNot", "");this.put("saUpdateTime", null);return this;};
	/** not .... */
	this.saUpdateTimeNot=function(){if(this.proxy)return this.getProxy().saUpdateTimeNot();this.put("saUpdateTimeNot", "not");return this;};
	this.saUpdateTimeNotNull=function(){if(this.proxy)return this.getProxy().saUpdateTimeNotNull();this.put("saUpdateTimeNot", "not");this.put("saUpdateTime", null);return this;};
	this.saUpdateTimeNot=function(saUpdateTime){if(this.proxy)return this.getProxy().saUpdateTimeNot(saUpdateTime);this.put("saUpdateTimeNot", "not");this.put("saUpdateTime", saUpdateTime);return this;};
		
	/** and sa_update_time >= ? */
	this.saUpdateTimeStart=function(start){if(this.proxy)return this.getProxy().saUpdateTimeStart(start);this.put("saUpdateTimeStart", start);return this;};			
	/** and sa_update_time <= ? */
	this.saUpdateTimeEnd=function(end){if(this.proxy)return this.getProxy().saUpdateTimeEnd(end);this.put("saUpdateTimeEnd", end);return this;};
		
		 
	
	
	/** 添加时间 [非空]       **/
	this.saAddTime=function(saAddTime){if(this.proxy)return this.getProxy().saAddTime(saAddTime);  this.put("saAddTime", saAddTime);return this;};
	/** and sa_add_time is null */
	this.saAddTimeNull=function(){if(this.proxy)return this.getProxy().saAddTimeNull();if(this.get("saAddTimeNot")==null)this.put("saAddTimeNot", "");this.put("saAddTime", null);return this;};
	/** not .... */
	this.saAddTimeNot=function(){if(this.proxy)return this.getProxy().saAddTimeNot();this.put("saAddTimeNot", "not");return this;};
	this.saAddTimeNotNull=function(){if(this.proxy)return this.getProxy().saAddTimeNotNull();this.put("saAddTimeNot", "not");this.put("saAddTime", null);return this;};
	this.saAddTimeNot=function(saAddTime){if(this.proxy)return this.getProxy().saAddTimeNot(saAddTime);this.put("saAddTimeNot", "not");this.put("saAddTime", saAddTime);return this;};
		
	/** and sa_add_time >= ? */
	this.saAddTimeStart=function(start){if(this.proxy)return this.getProxy().saAddTimeStart(start);this.put("saAddTimeStart", start);return this;};			
	/** and sa_add_time <= ? */
	this.saAddTimeEnd=function(end){if(this.proxy)return this.getProxy().saAddTimeEnd(end);this.put("saAddTimeEnd", end);return this;};
		
		 
	
	
	/** 状态 [非空]   0:测试中 1:正常 2:禁用     **/
	this.saStatus=function(saStatus){if(this.proxy)return this.getProxy().saStatus(saStatus);  this.put("saStatus", saStatus);return this;};
	/** and sa_status is null */
	this.saStatusNull=function(){if(this.proxy)return this.getProxy().saStatusNull();if(this.get("saStatusNot")==null)this.put("saStatusNot", "");this.put("saStatus", null);return this;};
	/** not .... */
	this.saStatusNot=function(){if(this.proxy)return this.getProxy().saStatusNot();this.put("saStatusNot", "not");return this;};
	this.saStatusNotNull=function(){if(this.proxy)return this.getProxy().saStatusNotNull();this.put("saStatusNot", "not");this.put("saStatus", null);return this;};
	this.saStatusNot=function(saStatus){if(this.proxy)return this.getProxy().saStatusNot(saStatus);this.put("saStatusNot", "not");this.put("saStatus", saStatus);return this;};
		
		
	this.saStatusIn=function(ids){
		if(this.proxy)return this.getProxy().saStatusIn(ids);  this.put("saStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有API接口 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/api/api.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取API接口分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/api/api.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取API接口 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/api/api.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvApi.get = function(id){
	var protocol = ux.ajax("/admin/api/api.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvApi;
	return null;
}

SrvApi.where = new SrvApi.Where(0,true);